import React,{useState,useEffect} from 'react';
import { Spinner } from 'reactstrap';

const ClassList = (props) => {
    let select = (classify)=>{
        props.setClass(classify);
    }
    return (
        <div className='albs'>
            {props.list.length==0?<Spinner style={{width:24,height:24,marginLeft:100,marginTop:8}}/>:props.list.map((item,i)=>{
                return <div key={i} onClick={(e)=>{select(item)}} className={`class-item ${props.select.id===item.id?'class-item-select':''}`}>{item.name}</div>
            })}
        </div>
    )
}

export default ClassList
